package org.wangblue.concrete_elements;

import org.wangblue.elements.ItemElement;
import org.wangblue.visitor.Visitor;

/**
 * @description: 实现元素接口，并在 accept 方法中调用访问者对象的访问方法。
 * @author: WangBlue (wangjiping596@gmail.com)
 * @create: 2024-10-02 11:23
 **/
public class Elect extends ItemElement {


    private final String model;
    private final double price;

    public Elect(String model, double price) {
        this.model = model;
        this.price = price;
    }

    public String getModel() {
        return model;
    }

    public double getPrice() {
        return price;
    }
    @Override
    public void accept(Visitor visitor) {
        visitor.visit(this);

    }
}
